package site.assad.schema;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/12/6 0:10
 * Description: 增强类的方法
 */
public class AdvcieMethods {

    //前置增强方法
    public void beforeGreeting(){
        System.out.println("Hello!");
    }

    //后置增强方法
    public void afterGreeting(int retVal){
        System.out.println("Goodbye！");
    }

    //环绕增强方法
    public void aroundGreeting(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("Hello!");
        pjp.proceed();
        System.out.println("Goodbye!");
    }

    //抛出异常增强方法
    public void afterThrowing(Exception ex){
        System.out.println(ex.getMessage());
    }

}
